﻿﻿using System;
using System.Collections.Generic;
using System.Text;
namespace WebApp.App.Models.Entity.Common
{
    public class sms_send:NRapid.Struct
    {
		public System.Int64 id;
		public System.String phone;
		public System.String content;
		public System.Int64? time;
		public System.Int64? success;
		public System.String code;
		#region 从get列表初始化实体类
		public static bool TryParse(NRapid.NameValueCollection get,out sms_send par)
		{
			par=new sms_send();
			try
			{
						System.Int64.TryParse(get["id"],out par.id);
						par.phone=get["phone"];
						par.content=get["content"];
						par.time=null;
						if(get["time"]!=null)
						{
							par.time=System.Int64.Parse(get["time"]);
						}
						par.success=null;
						if(get["success"]!=null)
						{
							par.success=System.Int64.Parse(get["success"]);
						}
						par.code=get["code"];
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public override void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"id\":");
					tw.Write(id.ToString());
					tw.Write(",");
					tw.Write("\"phone\":");
					tw.Write("\"");
					tw.Write(phone==null?"null":phone);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"content\":");
					tw.Write("\"");
					tw.Write(content==null?"null":content);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"time\":");
					tw.Write(time==null?"null" : time.ToString());
					tw.Write(",");
					tw.Write("\"success\":");
					tw.Write(success==null?"null" : success.ToString());
					tw.Write(",");
					tw.Write("\"code\":");
					tw.Write("\"");
					tw.Write(code==null?"null":code);
					tw.Write("\"");
			tw.Write("}");
		}
		#endregion
    }
}